<template>
	<view class="user-chat">
		<scroll-view :scroll-y="true" style="height: 100%;" >
			<block v-for="item,index in list" :key="index">
				<!-- 用户列表 -->
				<userChatList :item="item"/>
			</block>
		</scroll-view>
		<!-- 底部输入框 -->
		<userChatBottom  @submit="submit"/>
	</view>
</template>

<script setup>
	import userChatList from '../../component/user-chat/user-chat-list.vue';
	import userChatBottom from '../../component/user-chat/user-chat-bottom.vue';
	
	import {ref} from 'vue';
	
	const list = ref([
		{
			isme:false,
			userpic:"../../static/new.jpg",
			type:"text",
			data:"嘻嘻嘻",
			time:"1554970014000",//js默认生成的是13位时间戳
		},
		{
			isme:true,
			userpic:"../../static/new.jpg",
			type:"image",
			data:"../../static/new.jpg",
			time:"1555146414000",
		},
		{
			isme:false,
			userpic:"../../static/new.jpg",
			type:"image",
			data:"../../static/new.jpg",
			time:"1688221002000",//十位秒 13位毫秒
		},
		
		{
			isme:false,
			userpic:"../../static/new.jpg",
			type:"image",
			data:"../../static/new.jpg",
			time:"1688221002000",//十位秒 13位毫秒
		},
		
		{
			isme:false,
			userpic:"../../static/new.jpg",
			type:"image",
			data:"../../static/new.jpg",
			time:"1688221002000",//十位秒 13位毫秒
		}
	])
	
	function submit(val){
		console.log(val)
	}
</script>

<style lang="scss" scoped>
	.user-chat {
		padding: 10upx 20upx;
		box-sizing: border-box;
		height: calc(100% - 100upx);

		
	}
		
</style>
